//光伏相关接口
import api from '@/api/api'

// 获取发电概况信息
const reqsituation = (data) => {
	return api.post(`/homepage/overview/generation`, data)
}

// 查询电站列表---无分页(查询列表信息排除户用)
const reqQueryList = () => {
	return api.get(`/power/station/list2`)
}
//电站分页接口
const reqStationList = (data) => {
	return api.post(`/power/station/page`, data)
}


//电站详情接口
const reqStationDetail = (id) => {
	return api.get(`/power/station/${id}`)
}

/**
 * 获取整体发电历史以及计划----计划
 * @param {*}
 * @returns
 */
const reqPlanEletric = ({
	type = "0",
	yearFen = 2025
} = {}) => {
	const data = {
		type,
		yearFen
	}
	return api.post(`/theoretical/One/Jihua`, data)
}

//获取设备
/**
 * code: 默认equipment_inverter
 * dzId： 默认''
 * area：默认''
 */
const reqEqList = (code = 'equipment_inverter', dzId = '', area = '') => {
	return api.get(`/homepage/eqlistByeqType?code=${code}&dzId=${dzId}&area=${encodeURIComponent(area)}`)
}


//工单概况

const reqStateCount = (data) => {
	return api.get(`/workorders/state-counts`, data, )
}
//工单概况根据模块

const reqStateCountByModel = (modelId) => {
	return api.get(`/workorders/woByny/${modelId}`, )
}



// 获取设备状态和报警统计信息

const reqStateStatistics = (data) => {
	return api.post(`/homepage/equipment/statistics`, data)
}


// 获取功率归一化排名
const reqGetRanking = (data) => {
	return api.post(`/homepage/normalization/top`, data)
}

// 获取日满发小时排名
const reqHourRanking = (data) => {
	return api.post(`/homepage/full/powergeneration/top`, data)
}


// 获取节能减排信息
const reqEnergySaving = (type = 'month') => {
	return api.get(`/homepage/conservation/conservation?type=${type}`)
}

//获取逆变器列表
const reqInverterList = (data) => {
	return api.post(`/inverterInfo/page`, data)
}

//获取汇流箱列表
const reqCombinerList = (data) => {
	return api.post(`/combiner/page`, data)
}

//获取气象站列表
const reqWestationList = (data) => {
	return api.post(`/westation/page`, data)
}

//获取采集器列表
const reqCollectorList = (data) => {
	return api.post(`/collector/page`, data)
}


//获取电表列表
const reqMeterList = (data) => {
	return api.post(`/meter/page`, data)
}

//获取箱变列表
const reqTransformerList = (data) => {
	return api.post(`/transformer/page`, data)
}
//获取组件列表
const reqAssemblyList = (data) => {
	return api.post(`/assembly/page`, data)
}
//获取并网柜列表
const reqCabinetList = (data) => {
	return api.post(`/cabinet/page`, data)
}

//获取其他列表
const reqOtherList = (data) => {
	return api.post(`/other/page`, data)
}

//逆变器设备详情
const reqInverterDetail = (data) => {
	return api.post(`/inverterInfo/detail`, data)
}

//汇流箱设备详情
const reqCombinerDetail = (data) => {
	return api.get(`/combiner/detail`, data)
}
//气象站设备详情
const reqWestationDetail = (data) => {
	return api.get(`/westation/detail`, data)
}


//电表设备详情
const reqMeterDetail = (data) => {
	return api.get(`/meter/detail`, data)
}

//监控设备-历史数据《日》
const reqDayHistory = (data) => {
	return api.get(`/inverterInfo/getHistoryFormworkDay`, data)
}
//监控设备-历史数据《周》
const reqWeekHistory = (data) => {
	return api.get(`/inverterInfo/getHistoryFormworkWeek`, data)
}
//监控设备-历史数据《月》
const reqMonthHistory = (data) => {
	return api.post(`/inverter/history/month`, data)
}

//监控设备-历史数据《年》
const reqYearHistory = (data) => {
	return api.post(`/inverter/history/year`, data)
}
//监控设备-历史数据《总》
const reqTotalHistory = (data) => {
	return api.get(`/inverterInfo/getHistoryFormworkTotal`, data)
}





/**
 * 获取整体发电历史以及计划----实际
 * @param {*}
 * @returns
 */
const reqRealityElectric = ({
	type = "0",
	yearFen = 2025
} = {}) => {
	const data = {
		type,
		yearFen
	}
	return api.post(`/theoretical/One/FaDian`, data)
}
const apiArr = [{
		value: 'reqsituation',
		method: 'post'
	},
	{
		value: 'reqQueryList',
		method: 'get'
	},
	{
		value: 'reqPlanEletric',
		method: 'post'
	},
	{
		value: 'reqStateCount',
		method: 'get'
	},
	{
		value: 'reqStateStatistics',
		method: 'post'
	},
	{
		value: 'reqGetRanking',
		method: 'post'
	},
	{
		value: 'reqHourRanking',
		method: 'post'
	},

	{
		value: 'reqRealityElectric',
		method: 'post'
	},
]

export {
	reqsituation,
	reqQueryList,
	reqEqList,
	reqPlanEletric,
	reqStateCount,
	reqStateStatistics,
	reqGetRanking,
	reqHourRanking,
	reqEnergySaving,
	reqRealityElectric,
	reqStationList,
	reqStateCountByModel,
	reqInverterDetail,

	reqDayHistory,
	reqWeekHistory,
	reqMonthHistory,
	reqYearHistory,
	reqTotalHistory,
	reqInverterList,
	reqCombinerList,
	reqWestationList,
	reqCollectorList,
	reqMeterList,
	reqTransformerList,
	reqAssemblyList,
	reqCabinetList,
	reqOtherList,
	reqWestationDetail,
	reqStationDetail,
	apiArr
}